﻿/// <reference path="jquery-1.5.1.js" />

//Adminpanel
$(document).ready(function () {
    $("#adminpanel .control").hide();
    $("#admintoggle").click(
    function () {
        $("#adminpanel .control").toggle("slow");
    });
});
//Login
$(document).ready(function () {
    $("#logindialog").hide();
    $("#loginbutton").click(function () {
        $("#logindialog").dialog({ height: 250, width: 250, modal: true });
    });

});
//DatePicker
$(document).ready(function () {
    $("#EventDate").datetimepicker({
        timeFormat: 'h:m:s',
        dateFormat: 'dd.mm.yy'
    });
    $("#EndDate").datetimepicker({
        timeFormat: 'h:m:s',
        dateFormat: 'dd.mm.yy'
    });
    $("#m_Event_EndDate").datetimepicker({
        timeFormat: 'h:m:s',
        dateFormat: 'dd.mm.yy'
    });
    $("#m_Event_EventDate").datetimepicker({
        timeFormat: 'h:m:s',
        dateFormat: 'dd.mm.yy'
    });
});
//News
$(document).ready(function () {
    $(".readmore").click(function () {
    $(this).siblings("p").toggleClass("overflow");
    });
});

//Search
function searchClick() {
    var category = $("#searchList").val();
    var searchText = $("#txtSearch").val();
    var queryString = "SearchText=" + searchText + "&Category=" + category;
    $.post("/Search/Search", queryString, callBackSearch, "_default");
}